#!/bin/sh

sysctl -w net.ipv4.ip_forward=1

script_name="$(echo $FILES_DS | sed -n 's/.*:\x27\(.*\)\x27/\1/p')"

map_vnets_script_dst="/usr/local/bin/${script_name}"
if [ -f ${map_vnets_script_dst} ]
then
  # Already installed
  exit 1
fi


map_vnets_script_src="$MOUNT_DIR/${script_name}"

cp "${map_vnets_script_src}" "${map_vnets_script_dst}" 
chmod +x "${map_vnets_script_dst}"

(crontab -l ; echo "*/1 * * * * ${map_vnets_script_dst} > /var/log/${script_name}.log 2>&1") | crontab -

exit 0
